 //
//  Ball.h
//  Demo
//
//  Created by CG on 13-10-3.
//
//

#ifndef Demo_Ball_h
#define Demo_Ball_h

#include "Utils.h"
#include "BaseObject.h"

#include "cocos2d.h"
#include "Box2d.h"
#include <list>

using namespace cocos2d;


const static int kAimSpriteBatchNodeTag = 99;
const static int kAimSpriteTotalNumber = 5;


//class Ball : public cocos2d::CCNode, public cocos2d::CCTargetedTouchDelegate
class Ball : public BaseObject, public cocos2d::CCTargetedTouchDelegate
{
    
public:
    Ball();
    virtual ~Ball();
    
    virtual void initWithFileAndType(const char *pszFilename, ObjectType objType);
    virtual void CreateBody(b2World* pWorld);

    
    virtual void SetObjectPosition(const cocos2d::CCPoint &position);
    virtual void SetObjectScale(float scale);
    virtual void SetObjectRotation(float fRotation);
    
    virtual void onEnter();
    virtual void update(float dt);

	virtual bool ccTouchBegan(CCTouch* pTouch, CCEvent* pEvent);
    virtual void ccTouchMoved(CCTouch* pTouch, CCEvent* pEvent);
    virtual void ccTouchEnded(CCTouch* pTouch, CCEvent* pEvent);
    

    
private:
    bool IsTouchPointInBall(CCTouch* pTouchPos);
    
    
private:
    BallState m_ballState;

    std::list<CCSprite*> m_aimSpriteList;
};

#endif
